<%@ page import="javax.servlet.jsp.JspWriter" pageEncoding="utf-8"%>
<%@ page language="java" import="java.util.*" %>
<%@page import="com.flute.haflute.web.JobService4Web;"%>
<%
  String path = request.getContextPath();
  int freejobnodes = JobService4Web.getAllFreeNodes();
  String freenodesstr = "";
  if(freejobnodes>0){
	  for(int i = 1;i<=freejobnodes;i++){
		  freenodesstr = freenodesstr + "<option value= '" + i + "'>" + i + "</option>" ;
	  }
  }
    String title = "作业调度策略";
    int tab = 0;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=title %></title>
<link href="<%=path%>/css/admin.css" rel="stylesheet" type="text/css"/>
<link href="<%=path%>/css/pub.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" language="javascript">
var checknode="random";
function getRadioValue(radioName){
 var obj=document.getElementsByName(radioName);   
        for(var i=0;i<obj.length;i++){   
        if(obj[i].checked){ 
            checknode  =  obj[i].id
            return checknode;   
            }   
        }  
 }
 function checkingRadio(){
    var checkval = getRadioValue("nodecheck");
    if( checkval=="oppoint"){
      document.getElementById("freddnodes").style.display = "";
    }else{
      document.getElementById("freddnodes").style.display = "none";
    }
    
 }
 function adosubmit(){
    var mysel=document.getElementById("freddnodes");    
    var txt=mysel.options[mysel.options.selectedIndex].text;                                                                     //获取下拉列表框显示的文本 
    
    document.forms[0].action="./setnodecheckval.jsp?checknode="+checknode+"&checkval="+txt;
    document.forms[0].submit();
 }
   </script>
</head>
<body>
<!--heaer start-->
<div class="header"><img src="images/SystemName.gif" /></div>
<!--heaer end-->
<!--content start-->
<div class="content">
        <jsp:include page="/page/left_menu_admin.jsp" />
        <div class="right"> 
       <div class="title">作业调度策略</div>
	  <div style="line-height:30px; font-size:12px; padding-left:2em;">
	  <form  method="post">
	     请选择指定的节点选择方式<br /><input id="random" type="radio" name="nodecheck" checked="checked" onClick="checkingRadio();" />随机节点<br />
	     <input id="oppoint" type="radio" name="nodecheck"  onClick="checkingRadio();" />指定节点
	     <select name="freddnodes"  id="freddnodes" style="display:none;"> 
					<%= freenodesstr %>
				</select><br />
	     <input id="allnode" type="radio" name="nodecheck"  onClick="checkingRadio();" />全部节点<br />
	     <input class="button" type="button" name="dosubmit" value="提交" onclick="adosubmit();" />
	  </form>   
	  </div>
	  </div>
  </div>
  <div class="footer"></div>
  </body>
  </html>